<!-- 中软使用物资总览查看页面 -->
<template>
  <div style="height: 70vh;">
    <iframe :src="iframeUrl" scrolling="no" width="100%" :height="iframeHeight" frameborder="0" />
  </div>

</template>
<script>

export default {
  name: 'ZrPmsCheckMaterials',
  data() {
    return {
      iframeHeight: 800
    }
  },
  computed: {
    iframeUrl() {
      return `${process.env.VUE_APP_ZHONGRUAN_URL}checkMaterials`
    }
  },
  created() {
    window.addEventListener('message', (event) => {
      const base_url = ''
      if (event.origin === base_url) {
        return
      }
      // 获取高度
      if (event.data.type === 'getMaterialsInfo') {
        this.iframeHeight = event.data.height
        this.$emit('initIframeHeight', event.data.height)
      }
      // 下一步是否成功
      if (event.data.type === 'doNextSuccess') {
        this.$emit('initNextInfo', event.data.doNext)
      }
    })
  }

}
</script>

<style scoped lang='scss'></style>
